{template header}
<h4 style="padding-left:10px;;">
    <span>搜索</span>
    <i class="icon-search"></i>
</h4>
<form class="form-horizontal" method="post" action="">
    <div class="control-group search-group" style="margin:0px;padding:0px;">
        <label class="control-label">名称：</label>
        <div class="controls">
          <input type="text" placeholder="设置后其他选项忽略" name="name" value="{$search['name']}">
        </div>
    </div>
    <div class="control-group search-group" style="margin:0px;padding:0px;">
        <label class="control-label" >类别：</label>
        <div class="controls" id="custom_data">
            <select class="rootCat category" name="rootCat" data-value="{$search['rootCat']}"></select> 
        </div>
    </div>
    <div class="control-group search-group"style="margin:0px;padding:0px;" style="margin:0px;padding:0px;">
        <label class="control-label" >关联：</label>
        <div class="controls">
            <select name="filter1">
                <option value="">请选择</option>
                {loop $filterList1 $k $item}
                <option {if $search['filter1'] == $k} selected="selected" {/if} value="{$k}">$item</option>
                {/loop}
            </select>
        </div>
    </div>
    

    <div class="control-group search-group" style="margin:0px;margin-top:10px;margin-bottom:10px;padding:0px;">
        <div class="controls">
            <input type="hidden" value="search" name="s">
            <button class="btn" type="submit">提交</button>　
            <button class="btn" type="reset">重置</button>
        </div>
    </div>
</form>
<br>
<div class="bs-docs-example" style="clear:both;">
    <table class="table table-striped table-align">
        <thead>
            <tr>
                <th width="60">团购ID</th>
                <th width="70">图片</th>
                <th width="200">识货名称</th>
                <th width="150">开始时间</th>
                <th width="150">结束时间</th>
                <th width="100">状态</th>
                <th width="100">团购价</th>
                <th width="100">原价</th>
                <th>操作</th>
            </tr>
        </thead>
        <tbody>
            {loop $shihuoList $k $v}
            <tr id="{$v['groupon_id']}">
                <td>{$v['groupon_id']}</td>
                <td><img src={$v['img_path']} width=50 height=50></td>
                <td>{$v['title']}</td>
                <td>{$v['start_time']}</td>
                <td>{$v['finish_time']}</td>
                <td>{$v['status']}</td>
                <td>{$v['price']}</td>
                <td>{$v['original_price']}</td>
                <td>
                    {if empty($v['flashId'])}
                    <a class="btn btn-edit" target="_blank" onclick="$(this).remove()" href="?c=adminFlashBuy&a=addFlashBuy&shihuoGrouponId=$v['groupon_id']">导入</a>
                    {else}
                    <a class="btn btn-primary" target="_blank" href="?c=adminFlashBuy&a=addFlashBuy&flashId=$v['flashId']">修改</a>
                    {/if}    
                </td>
            </tr>
            {/loop}
        </tbody>
    </table>
</div>
<div class="pagination">
    <ul>
        {$pageStr}
    </ul>
</div>
<script src="/static/js/jquery.cxselect.min.js"></script>
<script>
    $('#custom_data').cxSelect({
  selects: ['rootCat'],
  jsonName: 'name',
  jsonValue: 'name',
  jsonSub: 'sub',
  data:  $rootCatJson
});
</script>
{template footer}
